
// https : // iai.sh.cn/problem/847
#include <iostream>
using namespace std;

const int MAX_SIZE = 100; // 定义最大矩阵大小
char mp[MAX_SIZE][MAX_SIZE];

int n;
void printMatrix() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << mp[i][j];
    }
    cout << endl;
  }
}

int main() {
  string s;
  cin >> n >> s;

  int num = 0;
  int H = 1, L = 1;
  int dir = 1;

  while (num < n * n) {
    mp[H][L] = s[num++];
    H -= dir;
    L += dir;

    if (H < 1 || H > n || L < 1 || L > n) {
      dir = -dir;
      if (H > n)
        H = n, L += 2;
      else if (L > n)
        L = n, H += 2;
      if (H < 1)
        H = 1;
      else if (L < 1)
        L = 1;
    }
  }
  printMatrix();

  return 0;
}
